

import logging
import os.path

import yaml

from tests.prictice_2 import PRACTICE_PATH

logging.basicConfig(level=logging.DEBUG)

DATA_PATH = os.path.join(PRACTICE_PATH, 'data', 'add_data.yml')
logging.debug(f"DATA_PATH: {DATA_PATH}")


def read_data(level, key):
    with open(DATA_PATH, encoding='utf-8') as f:
        data = yaml.safe_load(f)

        add_data = data['add']

        p0_data = add_data['P0']['datas']
        p0_ids = add_data['P0']['ids']
        logging.debug(add_data)
        logging.debug(p0_data)
        logging.debug(p0_ids)

    logging.debug(add_data)
    return add_data[level][key]


if __name__ == '__main__':
    read_data('P0', 'datas')